{**
 * Pharmacy edit
 *
 * @package   OpenEMR
 * @link      http://www.open-emr.org
 * @author    Brady Miller <brady.g.miller@gmail.com>
 * @copyright Copyright (c) 2017 Brady Miller <brady.g.miller@gmail.com>
 * @license   https://github.com/openemr/openemr/blob/master/LICENSE GNU General Public License 3
 *}
<form name="x12_partner" method="post" action="{$FORM_ACTION}" class='form-horizontal' onsubmit="return top.restoreSession()">
    <div class="form-group">
        <label for="name" class="control-label col-sm-2">{xl t='Partner Name'|escape:'html'}</label>
        <div class="col-sm-8">
            <input type="text" id="name" name="name" class="form-control" value="{$partner->get_name()|escape:'html'}" onKeyDown="PreventIt(event)">
        </div>
    </div>
    <div class="form-group">
        <label for="id_number" class="control-label col-sm-2">{xl t='ID Number (ETIN)'|escape:'html'}</label>
        <div class="col-sm-8">
            <input type="text" id="id_number" name="id_number" class="form-control" value="{$partner->get_id_number()|escape:'html'}" onKeyDown="PreventIt(event)">
        </div>
    </div>
    <div class="form-group">
        <label for="x12_isa01" class="control-label col-sm-2">{xl t='User logon Required Indicator (ISA01~ use 00 or 03)'|escape:'html'}</label>
        <div class="col-sm-8">
            <input type="text" id="x12_isa01" name="x12_isa01" class="form-control" value="{$partner->get_x12_isa01()|escape:'html'}" onKeyDown="PreventIt(event)">
        </div>
    </div>
    <div class="form-group">
        <label for="x12_isa02" class="control-label col-sm-2">{xl t='User Logon (If 03 above, else leave spaces) (ISA02)'|escape:'html'}</label>
        <div class="col-sm-8">
            <input type="text" id="x12_isa02" name="x12_isa02" class="form-control" value="{$partner->get_x12_isa02()|escape:'html'}" onKeyDown="PreventIt(event)">
        </div>
    </div>
    <div class="form-group">
        <label for="x12_isa03" class="control-label col-sm-2">{xl t='User password required Indicator (ISA03~ use 00 or 01)'|escape:'html'}</label>
        <div class="col-sm-8">
            <input type="text" id="x12_isa03" name="x12_isa03" class="form-control" value="{$partner->get_x12_isa03()|escape:'html'}" onKeyDown="PreventIt(event)">
        </div>
    </div>
    <div class="form-group">
        <label for="x12_isa04" class="control-label col-sm-2">{xl t='User Password (ISA04~ if 01 above, else leave spaces)'|escape:'html'}</label>
        <div class="col-sm-8">
            <input type="text" id="x12_isa04" name="x12_isa04" class="form-control" value="{$partner->get_x12_isa04()|escape:'html'}" onKeyDown="PreventIt(event)">
        </div>
    </div>
    <div class="form-group">
        <label for="x12_isa05" class="control-label col-sm-2">{xl t='Sender ID Qualifier (ISA05)'|escape:'html'}</label>
        <div class="col-sm-8">
            <select id="x12_isa05" name="x12_isa05" class="form-control">
                {html_options options=$partner->get_idqual_array() selected=$partner->get_x12_isa05()}
            </select>
        </div>
    </div>
    <div class="form-group">
        <label for="x12_sender_id" class="control-label col-sm-2">{xl t='Sender ID (ISA06)'|escape:'html'}</label>
        <div class="col-sm-8">
            <input type="text" id="x12_sender_id" name="x12_sender_id" class="form-control"  value="{$partner->get_x12_sender_id()|escape:'html'}" onKeyDown="PreventIt(event)">
        </div>
    </div>
    <div class="form-group">
        <label for="x12_isa07" class="control-label col-sm-2">{xl t='Receiver ID Qualifier (ISA07)'|escape:'html'}</label>
        <div class="col-sm-8">
            <select id="x12_isa07" name="x12_isa07" class="form-control">
                {html_options options=$partner->get_idqual_array() selected=$partner->get_x12_isa07()}
            </select>
        </div>
    </div>
    <div class="form-group">
        <label for="x12_receiver_id" class="control-label col-sm-2">{xl t='Receiver ID (ISA08)'|escape:'html'}</label>
        <div class="col-sm-8">
            <input type="text" id="x12_receiver_id" name="x12_receiver_id" class="form-control" value="{$partner->get_x12_receiver_id()}" onKeyDown="PreventIt(event)">
        </div>
    </div>
    <div class="form-group">
        <label for="x12_isa14" class="control-label col-sm-2">{xl t='Acknowledgment Requested (ISA14)'|escape:'html'}</label>
        <div class="col-sm-8">
            <select id="x12_isa14" name="x12_isa14" class="form-control">
                {html_options options=$partner->get_x12_isa14_array() selected=$partner->get_x12_isa14()}
            </select>
        </div>
    </div>
    <div class="form-group">
        <label for="x12_isa15" class="control-label col-sm-2">{xl t='Usage Indicator (ISA15)'|escape:'html'}</label>
        <div class="col-sm-8">
            <select id="x12_isa15" name="x12_isa15" class="form-control">
                {html_options options=$partner->get_x12_isa15_array() selected=$partner->get_x12_isa15()}
            </select>
        </div>
    </div>
    <div class="form-group">
        <label for="x12_gs02" class="control-label col-sm-2">{xl t='Application Sender Code (GS02)'|escape:'html'}</label>
        <div class="col-sm-8">
            <input type="text" id="x12_gs02" name="x12_gs02" class="form-control" value="{$partner->get_x12_gs02()|escape:'html'}" onKeyDown="PreventIt(event)">
        </div>
    </div>
    <div class="form-group">
        <label for="12_per06" class="control-label col-sm-2">{xl t='Submitter EDI Access Number (PER06)'|escape:'html'}</label>
        <div class="col-sm-8">
            <input type="text" id="12_per06" name="x12_per06" class="form-control" value="{$partner->get_x12_per06()|escape:'html'}" onKeyDown="PreventIt(event)">
        </div>
    </div>
    <div class="form-group">
        <label for="x12_version" class="control-label col-sm-2">{xl t='Version'|escape:'html'}</label>
        <div class="col-sm-8">
            <select id="x12_version" name="x12_version" class="form-control">
                {html_options options=$partner->get_x12_version_array() selected=$partner->get_x12_version()}
            </select>
        </div>
    </div>
    <div class="form-group">
        <label for="processing_format" class="control-label col-sm-2">{xl t='Processing format'|escape:'html'}</label>
        <div class="col-sm-8">
            <select id="x12_isa07" id="processing_format" name="processing_format" class="form-control">
                {html_options options=$partner->get_processing_format_array() selected=$partner->get_processing_format()}
            </select>
        </div>
    </div>
    <div class="form-group">
        <label for="x12_gs03" class="control-label col-sm-2">{xl t='Application Receiver Code (GS03 - If blank ISA08 will be used)'|escape:'html'}</label>
        <div class="col-sm-8">
            <input type="text" maxlength="15" id="x12_gs03" name="x12_gs03" class="form-control" value="{$partner->get_x12_gs03()|escape:'html'}" onKeyDown="PreventIt(event)">
        </div>
    </div>
    <div class="btn-group col-sm-offset-2">
        <a href="javascript:add_x12();" class="btn btn-default btn-save" onclick="top.restoreSession()">
            {xl t='Save'|escape:'html'}
        </a>
        <a href="controller.php?practice_settings&x12_partner&action=list"  class="btn btn-link btn-cancel" onclick="top.restoreSession()">
            {xl t='Cancel'|escape:'html'}
        </a>
    </div>
    <input type="hidden" name="id" value="{$partner->id|escape:'html'}" />
    <input type="hidden" name="process" value="{$PROCESS|escape:'html'}" />
    <input type="hidden" name="sub" value="no" />
</form>

{literal}
<script language="javascript">
function add_x12()
{
if (document.x12_partner.name.value.length>0)
{
top.restoreSession();
document.x12_partner.submit();
}
else
{
document.x12_partner.name.style.backgroundColor="red";
document.x12_partner.name.focus();
}
}

 function Waittoredirect(delaymsec) {
 var st = new Date();
 var et = null;
 do {
 et = new Date();
 } while ((et - st) < delaymsec);

   }
</script>
{/literal}